package demo.swing;

import javax.swing.JFrame;
import javax.swing.JLabel;

import com.jeans.trayicon.WindowsTrayIcon;

public class AlwaysOnTop extends JFrame {
	public AlwaysOnTop() {
		super();
		getContentPane().add(new JLabel("Test"));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		pack();
	}

	public static void main(String[] args) {
		WindowsTrayIcon.initTrayIcon("Test app");
		AlwaysOnTop app = new AlwaysOnTop();

		app.setVisible(true);
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		WindowsTrayIcon.initJAWT();
		WindowsTrayIcon.setAlwaysOnTop(app, true);
		System.out.println("Window should be always on top.");
	}
}
